package com.tubi.zifuliu;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class huanchongliu {
    public static void main(String[] args) throws IOException {
        BufferedReader bu = new BufferedReader(new FileReader("test-IO/a.txt"));
//        char[] chars = new char[1024];
//        int a;
//        while ((a=bu.read(chars))!=-1){
//            System.out.print(new String(chars,0,a));
//        }
//        bu.close();

        //一次读取一个字符数据
//        int ch;
//        while ((ch=br.read())!=-1) {
//            System.out.print((char)ch);
//        }

        //一次读取一个字符数组数据
        char[] chs = new char[1024];
        int len;
        while ((len=bu.read(chs))!=-1) {
            System.out.print(new String(chs,0,len));
        }

        bu.close();
    }
}
